package basic2;

public class Charge {

	public static void main(String[] args) {
		//잔돈 계산하는 프로그램
		
		int rest;
		int charge;
		int W10;
		int W50;
		int W100;
		int W500;
		int W1000;
		int W5000;
		int W10000;
		int W50000;
		
		charge = 8_7654_3210; // JDK7, 자릿수 구분
		W50000= charge/50000;
		rest = charge-(W50000*50000);
		W10000 = rest/10000;
	    rest = rest -(W10000*10000);
	    W5000 = rest/5000;
	    rest = rest -(W5000*5000);
	    W1000=rest/1000;
	    rest = rest -(W1000*1000);
	    W500 = rest /500;
	    rest = rest -(W500*500);
	    W100= rest/100;
	    rest = rest -(W100*100);
	    W50 = rest/50;
	    rest = rest -(W50*50);
	    W10 = rest/10;
	    
	    System.out.println("50000원권 "+W50000+"장  "+"10000원권"+W10000+"장  "+"5000원권"+W5000+"장  "+"1000원권"+W1000+"장  "+"500원"+W500+"개  "+"100원"+W100+"개  "+"50원"+W50+"개  "+"10원"+W10+"개 입니다.");
		
	}

}
